Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add electra support for light-client #7063

Merged
merged 10 commits into from
Sep 18, 2024
Merged

Conversation

matthewkeil
Copy link
Member

@matthewkeil matthewkeil commented Aug 29, 2024

Motivation

Branch created on behalf of the original author @ensi321. Replaces #7038 to avoid a difficult rebase due to the various rebases of the electra branch it was originally based on. Cherry-picked the commits over and will commit here with fixes for the errors that come up.

Verified that all code in commits up to c5bab83 were on current unstable and 0a33b9a starts novel code for from PR#7038

Description

Fix various places to comply with light client electra spec

Will be ready for review after #6986 is merged.

@matthewkeil matthewkeil requested a review from a team as a code owner August 29, 2024 23:44
@matthewkeil matthewkeil marked this pull request as draft August 29, 2024 23:45
@matthewkeil matthewkeil changed the title Mkeil/electra light client feat: add electra support for light-client Aug 29, 2024
Copy link
Contributor

github-actions bot commented Aug 30, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 5f97343 Previous: 2fcecd6 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.1435 ms/op 1.9308 ms/op 1.11
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 51.210 us/op 44.186 us/op 1.16
BLS verify - blst 896.08 us/op 1.2248 ms/op 0.73
BLS verifyMultipleSignatures 3 - blst 1.2957 ms/op 1.3265 ms/op 0.98
BLS verifyMultipleSignatures 8 - blst 1.9723 ms/op 2.5179 ms/op 0.78
BLS verifyMultipleSignatures 32 - blst 6.0307 ms/op 6.0753 ms/op 0.99
BLS verifyMultipleSignatures 64 - blst 11.301 ms/op 10.553 ms/op 1.07
BLS verifyMultipleSignatures 128 - blst 18.179 ms/op 16.899 ms/op 1.08
BLS deserializing 10000 signatures 695.90 ms/op 671.68 ms/op 1.04
BLS deserializing 100000 signatures 7.0226 s/op 6.7229 s/op 1.04
BLS verifyMultipleSignatures - same message - 3 - blst 1.0928 ms/op 1.0610 ms/op 1.03
BLS verifyMultipleSignatures - same message - 8 - blst 1.1516 ms/op 1.2710 ms/op 0.91
BLS verifyMultipleSignatures - same message - 32 - blst 1.8410 ms/op 1.7682 ms/op 1.04
BLS verifyMultipleSignatures - same message - 64 - blst 2.6914 ms/op 2.6735 ms/op 1.01
BLS verifyMultipleSignatures - same message - 128 - blst 4.4685 ms/op 4.2864 ms/op 1.04
BLS aggregatePubkeys 32 - blst 20.480 us/op 19.985 us/op 1.02
BLS aggregatePubkeys 128 - blst 71.070 us/op 71.136 us/op 1.00
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 88.150 ms/op 69.193 ms/op 1.27
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 71.178 ms/op 63.443 ms/op 1.12
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 37.022 ms/op 43.337 ms/op 0.85
getSlashingsAndExits - default max 104.50 us/op 192.50 us/op 0.54
getSlashingsAndExits - 2k 378.45 us/op 393.83 us/op 0.96
proposeBlockBody type=full, size=empty 5.7333 ms/op 7.4693 ms/op 0.77
isKnown best case - 1 super set check 312.00 ns/op 849.00 ns/op 0.37
isKnown normal case - 2 super set checks 293.00 ns/op 708.00 ns/op 0.41
isKnown worse case - 16 super set checks 300.00 ns/op 669.00 ns/op 0.45
InMemoryCheckpointStateCache - add get delete 2.6800 us/op 4.8210 us/op 0.56
updateUnfinalizedPubkeys - updating 10 pubkeys 1.3203 ms/op 2.1127 ms/op 0.62
updateUnfinalizedPubkeys - updating 100 pubkeys 4.2443 ms/op 6.1066 ms/op 0.70
updateUnfinalizedPubkeys - updating 1000 pubkeys 53.906 ms/op 71.215 ms/op 0.76
validate api signedAggregateAndProof - struct 2.0164 ms/op 2.0086 ms/op 1.00
validate gossip signedAggregateAndProof - struct 1.8720 ms/op 1.8446 ms/op 1.01
validate gossip attestation - vc 640000 1.0974 ms/op 1.2132 ms/op 0.90
batch validate gossip attestation - vc 640000 - chunk 32 136.35 us/op 163.21 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 64 117.67 us/op 139.88 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 128 108.62 us/op 124.17 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 256 111.34 us/op 125.00 us/op 0.89
pickEth1Vote - no votes 1.2047 ms/op 1.3157 ms/op 0.92
pickEth1Vote - max votes 6.4308 ms/op 9.4276 ms/op 0.68
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.510 ms/op 16.634 ms/op 0.75
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.990 ms/op 25.343 ms/op 0.83
pickEth1Vote - Eth1Data fastSerialize value x2048 529.73 us/op 604.11 us/op 0.88
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.4096 ms/op 4.9951 ms/op 0.88
bytes32 toHexString 467.00 ns/op 660.00 ns/op 0.71
bytes32 Buffer.toString(hex) 246.00 ns/op 287.00 ns/op 0.86
bytes32 Buffer.toString(hex) from Uint8Array 460.00 ns/op 505.00 ns/op 0.91
bytes32 Buffer.toString(hex) + 0x 251.00 ns/op 292.00 ns/op 0.86
Object access 1 prop 0.13700 ns/op 0.20500 ns/op 0.67
Map access 1 prop 0.13200 ns/op 0.15500 ns/op 0.85
Object get x1000 6.0910 ns/op 6.7940 ns/op 0.90
Map get x1000 6.6220 ns/op 6.9450 ns/op 0.95
Object set x1000 36.285 ns/op 50.896 ns/op 0.71
Map set x1000 24.110 ns/op 35.617 ns/op 0.68
Return object 10000 times 0.29910 ns/op 0.32360 ns/op 0.92
Throw Error 10000 times 3.4465 us/op 3.5976 us/op 0.96
toHex 163.58 ns/op 180.51 ns/op 0.91
Buffer.from 162.63 ns/op 167.06 ns/op 0.97
shared Buffer 99.852 ns/op 102.08 ns/op 0.98
fastMsgIdFn sha256 / 200 bytes 2.3860 us/op 2.5470 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 256.00 ns/op 288.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 200 bytes 286.00 ns/op 296.00 ns/op 0.97
fastMsgIdFn sha256 / 1000 bytes 7.6260 us/op 7.9310 us/op 0.96
fastMsgIdFn h32 xxhash / 1000 bytes 416.00 ns/op 445.00 ns/op 0.93
fastMsgIdFn h64 xxhash / 1000 bytes 362.00 ns/op 361.00 ns/op 1.00
fastMsgIdFn sha256 / 10000 bytes 65.132 us/op 68.626 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.9470 us/op 1.9960 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2310 us/op 1.2950 us/op 0.95
send data - 1000 256B messages 13.876 ms/op 15.236 ms/op 0.91
send data - 1000 512B messages 17.925 ms/op 18.436 ms/op 0.97
send data - 1000 1024B messages 25.995 ms/op 30.959 ms/op 0.84
send data - 1000 1200B messages 27.160 ms/op 32.995 ms/op 0.82
send data - 1000 2048B messages 32.346 ms/op 33.666 ms/op 0.96
send data - 1000 4096B messages 32.910 ms/op 35.137 ms/op 0.94
send data - 1000 16384B messages 76.709 ms/op 88.291 ms/op 0.87
send data - 1000 65536B messages 225.50 ms/op 243.52 ms/op 0.93
enrSubnets - fastDeserialize 64 bits 1.1180 us/op 1.5350 us/op 0.73
enrSubnets - ssz BitVector 64 bits 357.00 ns/op 475.00 ns/op 0.75
enrSubnets - fastDeserialize 4 bits 151.00 ns/op 246.00 ns/op 0.61
enrSubnets - ssz BitVector 4 bits 359.00 ns/op 535.00 ns/op 0.67
prioritizePeers score -10:0 att 32-0.1 sync 2-0 152.90 us/op 226.66 us/op 0.67
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 193.61 us/op 237.72 us/op 0.81
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 291.94 us/op 346.67 us/op 0.84
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 548.55 us/op 587.18 us/op 0.93
prioritizePeers score 0:0 att 64-1 sync 4-1 905.23 us/op 1.0862 ms/op 0.83
array of 16000 items push then shift 1.6796 us/op 1.8693 us/op 0.90
LinkedList of 16000 items push then shift 7.6780 ns/op 10.818 ns/op 0.71
array of 16000 items push then pop 134.23 ns/op 155.68 ns/op 0.86
LinkedList of 16000 items push then pop 7.5660 ns/op 9.4240 ns/op 0.80
array of 24000 items push then shift 2.4613 us/op 2.8893 us/op 0.85
LinkedList of 24000 items push then shift 7.6480 ns/op 10.100 ns/op 0.76
array of 24000 items push then pop 163.05 ns/op 211.81 ns/op 0.77
LinkedList of 24000 items push then pop 7.4690 ns/op 11.226 ns/op 0.67
intersect bitArray bitLen 8 6.4940 ns/op 8.4790 ns/op 0.77
intersect array and set length 8 50.422 ns/op 92.370 ns/op 0.55
intersect bitArray bitLen 128 30.413 ns/op 36.395 ns/op 0.84
intersect array and set length 128 714.71 ns/op 1.0508 us/op 0.68
bitArray.getTrueBitIndexes() bitLen 128 2.2880 us/op 3.0080 us/op 0.76
bitArray.getTrueBitIndexes() bitLen 248 4.9380 us/op 4.9820 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 512 8.2780 us/op 10.207 us/op 0.81
Buffer.concat 32 items 1.0090 us/op 1.1460 us/op 0.88
Uint8Array.set 32 items 1.9090 us/op 1.8770 us/op 1.02
Buffer.copy 2.3430 us/op 2.1640 us/op 1.08
Uint8Array.set - with subarray 3.3980 us/op 3.6090 us/op 0.94
Uint8Array.set - without subarray 2.0830 us/op 1.8990 us/op 1.10
getUint32 - dataview 251.00 ns/op 317.00 ns/op 0.79
getUint32 - manual 165.00 ns/op 285.00 ns/op 0.58
Set add up to 64 items then delete first 2.2615 us/op 3.1870 us/op 0.71
OrderedSet add up to 64 items then delete first 3.4051 us/op 5.2073 us/op 0.65
Set add up to 64 items then delete last 2.5010 us/op 3.9774 us/op 0.63
OrderedSet add up to 64 items then delete last 3.6241 us/op 5.7356 us/op 0.63
Set add up to 64 items then delete middle 2.5147 us/op 3.5122 us/op 0.72
OrderedSet add up to 64 items then delete middle 5.2124 us/op 7.3252 us/op 0.71
Set add up to 128 items then delete first 5.1420 us/op 7.2275 us/op 0.71
OrderedSet add up to 128 items then delete first 8.0097 us/op 11.380 us/op 0.70
Set add up to 128 items then delete last 4.9460 us/op 7.1865 us/op 0.69
OrderedSet add up to 128 items then delete last 7.4899 us/op 11.360 us/op 0.66
Set add up to 128 items then delete middle 4.9263 us/op 7.3924 us/op 0.67
OrderedSet add up to 128 items then delete middle 13.545 us/op 19.487 us/op 0.70
Set add up to 256 items then delete first 10.539 us/op 14.445 us/op 0.73
OrderedSet add up to 256 items then delete first 16.018 us/op 23.317 us/op 0.69
Set add up to 256 items then delete last 9.6775 us/op 14.904 us/op 0.65
OrderedSet add up to 256 items then delete last 14.380 us/op 23.182 us/op 0.62
Set add up to 256 items then delete middle 10.078 us/op 14.290 us/op 0.71
OrderedSet add up to 256 items then delete middle 41.681 us/op 51.318 us/op 0.81
transfer serialized Status (84 B) 1.4850 us/op 1.5930 us/op 0.93
copy serialized Status (84 B) 1.1110 us/op 1.5760 us/op 0.70
transfer serialized SignedVoluntaryExit (112 B) 1.4530 us/op 1.6440 us/op 0.88
copy serialized SignedVoluntaryExit (112 B) 1.1410 us/op 1.4270 us/op 0.80
transfer serialized ProposerSlashing (416 B) 1.5600 us/op 2.3020 us/op 0.68
copy serialized ProposerSlashing (416 B) 1.4770 us/op 2.1430 us/op 0.69
transfer serialized Attestation (485 B) 1.5310 us/op 2.0910 us/op 0.73
copy serialized Attestation (485 B) 1.6330 us/op 2.1160 us/op 0.77
transfer serialized AttesterSlashing (33232 B) 2.3260 us/op 2.9100 us/op 0.80
copy serialized AttesterSlashing (33232 B) 5.6710 us/op 9.1610 us/op 0.62
transfer serialized Small SignedBeaconBlock (128000 B) 3.9190 us/op 3.0430 us/op 1.29
copy serialized Small SignedBeaconBlock (128000 B) 15.561 us/op 28.348 us/op 0.55
transfer serialized Avg SignedBeaconBlock (200000 B) 3.6860 us/op 3.8380 us/op 0.96
copy serialized Avg SignedBeaconBlock (200000 B) 21.965 us/op 41.740 us/op 0.53
transfer serialized BlobsSidecar (524380 B) 2.5870 us/op 4.5760 us/op 0.57
copy serialized BlobsSidecar (524380 B) 93.922 us/op 132.17 us/op 0.71
transfer serialized Big SignedBeaconBlock (1000000 B) 2.6590 us/op 5.4080 us/op 0.49
copy serialized Big SignedBeaconBlock (1000000 B) 134.01 us/op 316.72 us/op 0.42
pass gossip attestations to forkchoice per slot 2.7780 ms/op 3.2762 ms/op 0.85
forkChoice updateHead vc 100000 bc 64 eq 0 577.00 us/op 811.30 us/op 0.71
forkChoice updateHead vc 600000 bc 64 eq 0 3.0864 ms/op 3.7667 ms/op 0.82
forkChoice updateHead vc 1000000 bc 64 eq 0 5.2171 ms/op 9.2597 ms/op 0.56
forkChoice updateHead vc 600000 bc 320 eq 0 2.9591 ms/op 4.0927 ms/op 0.72
forkChoice updateHead vc 600000 bc 1200 eq 0 3.0545 ms/op 3.9074 ms/op 0.78
forkChoice updateHead vc 600000 bc 7200 eq 0 3.5602 ms/op 4.8624 ms/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 1000 10.895 ms/op 14.084 ms/op 0.77
forkChoice updateHead vc 600000 bc 64 eq 10000 10.656 ms/op 13.517 ms/op 0.79
forkChoice updateHead vc 600000 bc 64 eq 300000 14.765 ms/op 22.125 ms/op 0.67
computeDeltas 500000 validators 300 proto nodes 3.4819 ms/op 4.8264 ms/op 0.72
computeDeltas 500000 validators 1200 proto nodes 3.5088 ms/op 4.5687 ms/op 0.77
computeDeltas 500000 validators 7200 proto nodes 3.5606 ms/op 3.7978 ms/op 0.94
computeDeltas 750000 validators 300 proto nodes 5.2839 ms/op 5.4425 ms/op 0.97
computeDeltas 750000 validators 1200 proto nodes 5.1951 ms/op 5.3917 ms/op 0.96
computeDeltas 750000 validators 7200 proto nodes 5.1303 ms/op 5.1939 ms/op 0.99
computeDeltas 1400000 validators 300 proto nodes 9.7013 ms/op 9.8673 ms/op 0.98
computeDeltas 1400000 validators 1200 proto nodes 9.6057 ms/op 9.9183 ms/op 0.97
computeDeltas 1400000 validators 7200 proto nodes 9.8488 ms/op 10.023 ms/op 0.98
computeDeltas 2100000 validators 300 proto nodes 15.092 ms/op 14.974 ms/op 1.01
computeDeltas 2100000 validators 1200 proto nodes 14.747 ms/op 14.864 ms/op 0.99
computeDeltas 2100000 validators 7200 proto nodes 14.745 ms/op 15.111 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 1.7246 ms/op 2.3009 ms/op 0.75
altair processAttestation - 250000 vs - 7PWei worstcase 2.4149 ms/op 3.2154 ms/op 0.75
altair processAttestation - setStatus - 1/6 committees join 84.093 us/op 100.39 us/op 0.84
altair processAttestation - setStatus - 1/3 committees join 168.37 us/op 195.53 us/op 0.86
altair processAttestation - setStatus - 1/2 committees join 232.27 us/op 262.93 us/op 0.88
altair processAttestation - setStatus - 2/3 committees join 318.76 us/op 336.15 us/op 0.95
altair processAttestation - setStatus - 4/5 committees join 461.05 us/op 531.22 us/op 0.87
altair processAttestation - setStatus - 100% committees join 532.35 us/op 593.14 us/op 0.90
altair processBlock - 250000 vs - 7PWei normalcase 5.1948 ms/op 5.3779 ms/op 0.97
altair processBlock - 250000 vs - 7PWei normalcase hashState 37.035 ms/op 27.416 ms/op 1.35
altair processBlock - 250000 vs - 7PWei worstcase 44.817 ms/op 41.602 ms/op 1.08
altair processBlock - 250000 vs - 7PWei worstcase hashState 101.21 ms/op 84.104 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4667 ms/op 2.3668 ms/op 1.04
phase0 processBlock - 250000 vs - 7PWei worstcase 33.604 ms/op 26.837 ms/op 1.25
altair processEth1Data - 250000 vs - 7PWei normalcase 293.02 us/op 415.13 us/op 0.71
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.8620 us/op 9.5170 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 45.666 us/op 58.415 us/op 0.78
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 7.6210 us/op 13.790 us/op 0.55
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 8.1360 us/op 8.2180 us/op 0.99
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 185.24 us/op 202.04 us/op 0.92
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 2.0069 ms/op 1.4789 ms/op 1.36
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.2996 ms/op 1.6812 ms/op 1.37
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.8455 ms/op 2.0801 ms/op 1.37
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.3085 ms/op 4.7226 ms/op 0.70
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 3.1299 ms/op 1.9605 ms/op 1.60
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.4846 ms/op 4.5128 ms/op 0.77
Tree 40 250000 create 216.87 ms/op 286.16 ms/op 0.76
Tree 40 250000 get(125000) 138.67 ns/op 163.82 ns/op 0.85
Tree 40 250000 set(125000) 647.34 ns/op 784.44 ns/op 0.83
Tree 40 250000 toArray() 14.770 ms/op 20.612 ms/op 0.72
Tree 40 250000 iterate all - toArray() + loop 14.778 ms/op 20.644 ms/op 0.72
Tree 40 250000 iterate all - get(i) 50.407 ms/op 59.311 ms/op 0.85
Array 250000 create 2.7953 ms/op 3.8144 ms/op 0.73
Array 250000 clone - spread 1.3185 ms/op 1.6366 ms/op 0.81
Array 250000 get(125000) 0.40500 ns/op 0.43600 ns/op 0.93
Array 250000 set(125000) 0.41600 ns/op 0.46100 ns/op 0.90
Array 250000 iterate all - loop 106.80 us/op 108.20 us/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 88.596 ms/op 95.892 ms/op 0.92
Array.fill - length 1000000 3.4490 ms/op 4.6831 ms/op 0.74
Array push - length 1000000 17.094 ms/op 21.599 ms/op 0.79
Array.get 0.26325 ns/op 0.31086 ns/op 0.85
Uint8Array.get 0.42456 ns/op 0.44734 ns/op 0.95
phase0 beforeProcessEpoch - 250000 vs - 7PWei 15.051 ms/op 16.947 ms/op 0.89
altair processEpoch - mainnet_e81889 341.78 ms/op 319.57 ms/op 1.07
mainnet_e81889 - altair beforeProcessEpoch 17.287 ms/op 18.256 ms/op 0.95
mainnet_e81889 - altair processJustificationAndFinalization 18.790 us/op 11.569 us/op 1.62
mainnet_e81889 - altair processInactivityUpdates 4.8971 ms/op 6.1401 ms/op 0.80
mainnet_e81889 - altair processRewardsAndPenalties 62.557 ms/op 50.945 ms/op 1.23
mainnet_e81889 - altair processRegistryUpdates 2.4890 us/op 2.1410 us/op 1.16
mainnet_e81889 - altair processSlashings 603.00 ns/op 664.00 ns/op 0.91
mainnet_e81889 - altair processEth1DataReset 493.00 ns/op 958.00 ns/op 0.51
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.5691 ms/op 2.3380 ms/op 1.53
mainnet_e81889 - altair processSlashingsReset 4.6820 us/op 3.7210 us/op 1.26
mainnet_e81889 - altair processRandaoMixesReset 5.5830 us/op 5.3710 us/op 1.04
mainnet_e81889 - altair processHistoricalRootsUpdate 989.00 ns/op 751.00 ns/op 1.32
mainnet_e81889 - altair processParticipationFlagUpdates 3.0660 us/op 2.5180 us/op 1.22
mainnet_e81889 - altair processSyncCommitteeUpdates 819.00 ns/op 492.00 ns/op 1.66
mainnet_e81889 - altair afterProcessEpoch 93.094 ms/op 99.988 ms/op 0.93
capella processEpoch - mainnet_e217614 1.2844 s/op 1.4282 s/op 0.90
mainnet_e217614 - capella beforeProcessEpoch 72.868 ms/op 85.657 ms/op 0.85
mainnet_e217614 - capella processJustificationAndFinalization 22.644 us/op 24.267 us/op 0.93
mainnet_e217614 - capella processInactivityUpdates 17.865 ms/op 19.964 ms/op 0.89
mainnet_e217614 - capella processRewardsAndPenalties 242.68 ms/op 262.46 ms/op 0.92
mainnet_e217614 - capella processRegistryUpdates 15.592 us/op 15.262 us/op 1.02
mainnet_e217614 - capella processSlashings 438.00 ns/op 467.00 ns/op 0.94
mainnet_e217614 - capella processEth1DataReset 479.00 ns/op 293.00 ns/op 1.63
mainnet_e217614 - capella processEffectiveBalanceUpdates 14.119 ms/op 16.742 ms/op 0.84
mainnet_e217614 - capella processSlashingsReset 3.2500 us/op 7.7700 us/op 0.42
mainnet_e217614 - capella processRandaoMixesReset 3.9650 us/op 7.6730 us/op 0.52
mainnet_e217614 - capella processHistoricalRootsUpdate 643.00 ns/op 593.00 ns/op 1.08
mainnet_e217614 - capella processParticipationFlagUpdates 2.1120 us/op 3.1160 us/op 0.68
mainnet_e217614 - capella afterProcessEpoch 244.07 ms/op 280.90 ms/op 0.87
phase0 processEpoch - mainnet_e58758 341.93 ms/op 426.96 ms/op 0.80
mainnet_e58758 - phase0 beforeProcessEpoch 71.189 ms/op 78.788 ms/op 0.90
mainnet_e58758 - phase0 processJustificationAndFinalization 19.380 us/op 19.398 us/op 1.00
mainnet_e58758 - phase0 processRewardsAndPenalties 29.808 ms/op 30.073 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 8.3680 us/op 8.0650 us/op 1.04
mainnet_e58758 - phase0 processSlashings 378.00 ns/op 430.00 ns/op 0.88
mainnet_e58758 - phase0 processEth1DataReset 360.00 ns/op 350.00 ns/op 1.03
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.7634 ms/op 1.3577 ms/op 1.30
mainnet_e58758 - phase0 processSlashingsReset 3.8210 us/op 3.6720 us/op 1.04
mainnet_e58758 - phase0 processRandaoMixesReset 5.8110 us/op 6.1800 us/op 0.94
mainnet_e58758 - phase0 processHistoricalRootsUpdate 628.00 ns/op 556.00 ns/op 1.13
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.1330 us/op 3.6470 us/op 1.13
mainnet_e58758 - phase0 afterProcessEpoch 81.079 ms/op 86.822 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6912 ms/op 1.4368 ms/op 1.18
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 3.2951 ms/op 3.4629 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 19.958 ms/op 19.677 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 18.696 ms/op 19.280 ms/op 0.97
phase0 processRegistryUpdates - 250000 normalcase 8.3100 us/op 8.4990 us/op 0.98
phase0 processRegistryUpdates - 250000 badcase_full_deposits 367.08 us/op 377.52 us/op 0.97
phase0 processRegistryUpdates - 250000 worstcase 0.5 138.19 ms/op 130.00 ms/op 1.06
altair processRewardsAndPenalties - 250000 normalcase 42.001 ms/op 40.003 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 41.931 ms/op 46.184 ms/op 0.91
phase0 getAttestationDeltas - 250000 normalcase 8.2614 ms/op 8.0297 ms/op 1.03
phase0 getAttestationDeltas - 250000 worstcase 7.3459 ms/op 8.2718 ms/op 0.89
phase0 processSlashings - 250000 worstcase 122.74 us/op 112.07 us/op 1.10
altair processSyncCommitteeUpdates - 250000 132.89 ms/op 132.84 ms/op 1.00
BeaconState.hashTreeRoot - No change 285.00 ns/op 337.00 ns/op 0.85
BeaconState.hashTreeRoot - 1 full validator 94.575 us/op 103.33 us/op 0.92
BeaconState.hashTreeRoot - 32 full validator 943.15 us/op 1.2287 ms/op 0.77
BeaconState.hashTreeRoot - 512 full validator 9.7751 ms/op 13.786 ms/op 0.71
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 147.28 us/op 142.71 us/op 1.03
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0782 ms/op 1.9023 ms/op 1.09
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 31.954 ms/op 26.388 ms/op 1.21
BeaconState.hashTreeRoot - 1 balances 131.79 us/op 87.997 us/op 1.50
BeaconState.hashTreeRoot - 32 balances 1.2795 ms/op 866.69 us/op 1.48
BeaconState.hashTreeRoot - 512 balances 10.441 ms/op 14.264 ms/op 0.73
BeaconState.hashTreeRoot - 250000 balances 197.51 ms/op 319.04 ms/op 0.62
aggregationBits - 2048 els - zipIndexesInBitList 27.108 us/op 47.528 us/op 0.57
byteArrayEquals 32 54.686 ns/op 66.414 ns/op 0.82
Buffer.compare 32 17.680 ns/op 20.003 ns/op 0.88
byteArrayEquals 1024 1.6157 us/op 1.7575 us/op 0.92
Buffer.compare 1024 26.016 ns/op 26.780 ns/op 0.97
byteArrayEquals 16384 25.738 us/op 27.317 us/op 0.94
Buffer.compare 16384 205.59 ns/op 205.57 ns/op 1.00
byteArrayEquals 123687377 202.13 ms/op 201.91 ms/op 1.00
Buffer.compare 123687377 8.4899 ms/op 8.0454 ms/op 1.06
byteArrayEquals 32 - diff last byte 55.221 ns/op 53.441 ns/op 1.03
Buffer.compare 32 - diff last byte 18.572 ns/op 17.959 ns/op 1.03
byteArrayEquals 1024 - diff last byte 1.6515 us/op 1.6376 us/op 1.01
Buffer.compare 1024 - diff last byte 27.586 ns/op 28.197 ns/op 0.98
byteArrayEquals 16384 - diff last byte 27.330 us/op 25.716 us/op 1.06
Buffer.compare 16384 - diff last byte 212.64 ns/op 199.41 ns/op 1.07
byteArrayEquals 123687377 - diff last byte 195.74 ms/op 193.22 ms/op 1.01
Buffer.compare 123687377 - diff last byte 8.3569 ms/op 7.9196 ms/op 1.06
byteArrayEquals 32 - random bytes 5.2850 ns/op 5.2410 ns/op 1.01
Buffer.compare 32 - random bytes 17.654 ns/op 17.319 ns/op 1.02
byteArrayEquals 1024 - random bytes 5.3460 ns/op 5.2380 ns/op 1.02
Buffer.compare 1024 - random bytes 17.569 ns/op 17.303 ns/op 1.02
byteArrayEquals 16384 - random bytes 5.2450 ns/op 5.2410 ns/op 1.00
Buffer.compare 16384 - random bytes 17.518 ns/op 17.332 ns/op 1.01
byteArrayEquals 123687377 - random bytes 6.6000 ns/op 6.5300 ns/op 1.01
Buffer.compare 123687377 - random bytes 19.310 ns/op 18.880 ns/op 1.02
regular array get 100000 times 33.819 us/op 43.603 us/op 0.78
wrappedArray get 100000 times 43.079 us/op 33.722 us/op 1.28
arrayWithProxy get 100000 times 14.712 ms/op 14.421 ms/op 1.02
ssz.Root.equals 46.863 ns/op 46.964 ns/op 1.00
byteArrayEquals 46.251 ns/op 46.026 ns/op 1.00
Buffer.compare 10.776 ns/op 10.674 ns/op 1.01
shuffle list - 16384 els 6.4383 ms/op 6.3934 ms/op 1.01
shuffle list - 250000 els 94.940 ms/op 93.979 ms/op 1.01
processSlot - 1 slots 17.435 us/op 12.448 us/op 1.40
processSlot - 32 slots 3.9839 ms/op 2.3705 ms/op 1.68
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 38.018 ms/op 39.139 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.1961 ms/op 2.1472 ms/op 1.02
getCommitteeAssignments - req 100 vs - 250000 vc 4.2048 ms/op 4.0865 ms/op 1.03
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5910 ms/op 4.4462 ms/op 1.03
findModifiedValidators - 10000 modified validators 256.18 ms/op 257.97 ms/op 0.99
findModifiedValidators - 1000 modified validators 166.79 ms/op 187.87 ms/op 0.89
findModifiedValidators - 100 modified validators 141.67 ms/op 149.67 ms/op 0.95
findModifiedValidators - 10 modified validators 153.31 ms/op 163.40 ms/op 0.94
findModifiedValidators - 1 modified validators 143.29 ms/op 159.99 ms/op 0.90
findModifiedValidators - no difference 148.34 ms/op 171.56 ms/op 0.86
compare ViewDUs 3.0011 s/op 3.1683 s/op 0.95
compare each validator Uint8Array 1.7234 s/op 1.1089 s/op 1.55
compare ViewDU to Uint8Array 1.0157 s/op 955.50 ms/op 1.06
migrate state 1000000 validators, 24 modified, 0 new 606.70 ms/op 559.69 ms/op 1.08
migrate state 1000000 validators, 1700 modified, 1000 new 886.12 ms/op 745.32 ms/op 1.19
migrate state 1000000 validators, 3400 modified, 2000 new 1.0894 s/op 1.0896 s/op 1.00
migrate state 1500000 validators, 24 modified, 0 new 627.07 ms/op 595.73 ms/op 1.05
migrate state 1500000 validators, 1700 modified, 1000 new 821.69 ms/op 826.16 ms/op 0.99
migrate state 1500000 validators, 3400 modified, 2000 new 1.1075 s/op 952.94 ms/op 1.16
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3600 ns/op 4.8100 ns/op 0.91
state getBlockRootAtSlot - 250000 vs - 7PWei 882.52 ns/op 477.70 ns/op 1.85
computeProposers - vc 250000 7.6652 ms/op 7.2697 ms/op 1.05
computeEpochShuffling - vc 250000 92.085 ms/op 92.940 ms/op 0.99
getNextSyncCommittee - vc 250000 121.70 ms/op 118.66 ms/op 1.03
computeSigningRoot for AttestationData 22.971 us/op 24.433 us/op 0.94
hash AttestationData serialized data then Buffer.toString(base64) 1.5301 us/op 1.5296 us/op 1.00
toHexString serialized data 856.05 ns/op 891.98 ns/op 0.96
Buffer.toString(base64) 173.41 ns/op 181.19 ns/op 0.96
nodejs block root to RootHex using toHex 149.04 ns/op 162.10 ns/op 0.92
nodejs block root to RootHex using toRootHex 92.323 ns/op 97.682 ns/op 0.95
browser block root to RootHex using the deprecated toHexString 226.68 ns/op 234.72 ns/op 0.97
browser block root to RootHex using toHex 182.97 ns/op 184.51 ns/op 0.99
browser block root to RootHex using toRootHex 159.57 ns/op 160.30 ns/op 1.00

by benchmarkbot/action

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 65.21739% with 24 lines in your changes missing coverage. Please review.

Project coverage is 50.90%. Comparing base (a7286bd) to head (9e5adb6).
Report is 26 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7063      +/-   ##
============================================
+ Coverage     49.37%   50.90%   +1.53%     
============================================
  Files           589      595       +6     
  Lines         39233    39652     +419     
  Branches       2246     2268      +22     
============================================
+ Hits          19370    20184     +814     
+ Misses        19822    19468     -354     
+ Partials         41        0      -41     

@matthewkeil matthewkeil marked this pull request as ready for review September 3, 2024 13:21
@philknows philknows added this to the v1.22.0 milestone Sep 3, 2024
wemeetagain
wemeetagain previously approved these changes Sep 9, 2024
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

light client spec tests are currently disabled, this branch should pass those?

@ensi321 ensi321 marked this pull request as draft September 17, 2024 04:44
@ensi321
Copy link
Contributor

ensi321 commented Sep 17, 2024

light client spec tests are currently disabled, this branch should pass those?

Good call. Enabled.

@ensi321 ensi321 marked this pull request as ready for review September 17, 2024 05:30
Copy link
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ensi321 ensi321 merged commit bb40ef7 into unstable Sep 18, 2024
20 checks passed
@ensi321 ensi321 deleted the mkeil/electra-light-client branch September 18, 2024 19:09
philknows pushed a commit that referenced this pull request Sep 27, 2024
* Add constant

* Use constants

* Remove ZERO_NEXT_SYNC_COMMITTEE_BRANCH

* Add normalizeMerkleBranch

* add getId to CheckpointHeaderRepository

* fix: light-client unit tests

* chore: lint

* Fix normalizeMerkleBranch

* Enable LC spec test

* fix spec test

---------

Co-authored-by: NC <[email protected]>
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.23.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants